package nus.ss.thread;

public class ThreadDemoOne extends Thread{
    @Override
    //继承了Thread 则重写run方法
    public void run() {
        for (int i = 0; i < 100; i++) {//Thread.currentThread() 找到当前线程
            try {
                Thread.sleep(200); //休眠 使得三个进程不会堆在一起 都可以进行
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName() + " Hello World");

        }
    }
}
